function Rectangle(name, width, height) {
  this.name = name;
  this.width = width;
  this.height = height;
  this.area = function () {
  	return this.width * this.height;
  };
}
Rectangle.prototype.perimeter = function () {
  return 2 * (this.width + this.height);
 };
 Rectangle.prototype.isSquare = function () {
  return this.width === this.height;
 };
 Rectangle.prototype.changeName = function (newName) {
  this.name = newName;
 };
 const rect = new Rectangle("矩形 1", 10, 10);
 console.log(rect.area()); // 输出：100
 console.log(rect.perimeter()); // 输出：40
 console.log(rect.isSquare()); // 输出：true
 rect.changeName("测试矩形");
 console.log(rect.name); // 输出：测试矩形
 console.log(Object.getPrototypeOf(rect));

